You are here: Scripting Reference > Data Types > Float (Double, Extended, Currency)

Float (Double, Extended, Currency)

Declaration

var myvariable : double;

var myvariable : extended;

var myvariable : currency;

Example

procedure ScriptEvent (var Value : variant)

var myvariable : double

begin

myvariable := 123.45;

loginfo('the value of myvariable is '+FloatToStr(myvariable));

end

Description

Float is used to represent floating point values. Floating point values are numbers that have decimal places.

Float can store a number between -5.0 x 10^324 and 1.7 x 10^308

Extended can store a larger number between -3.6 x 10^4951 and 1.1 x 10^4932. Use this for scientific type data.

Currency is intended for monetary values. It is fixed at 4dp and is designed to reduce rounding errors. Currency can store a number between -922337203685477.5808 and 922337203685477.5807.

If you try to store a number in a data type that is unable to fit that number you will receive an Overflow error.

If a field within a DB/File Definition is specified as Float then it may require a display format for it to be correctly saved to the database/file in the correct number of decimal places. Use the display format #0.00 to display as 2 decimal places.